const showtoast=({title="正在加载中",icon="none",duration=2000,mask=true}={})=>{
  wx.showToast({
    title,
    icon,
    duration,
    mask
  })
}
wx.toast=showtoast
export {showtoast}

const showmodel=(options={})=>{
  return new Promise((resolve)=>{
    const defaultopt={
      title:"提示",
      content:"你确定执行该操作吗？",
      confirmColor:'#f3514f'
    }
   const opts= Object.assign({},defaultopt,options)
   wx.showModal({
     ...opts,
     complete(confirm,cancel){
       confirm && resolve(true)
       cancel && resolve(false)
     }
     
   })
  })
}
wx.model=showmodel
export {showmodel}